<?php

require_once 'func_theme.php';
require_once 'func_panel.php';

option_load();

//Remove unused wp_head for SEO
remove_action( 'wp_head', 'wp_shortlink_wp_head', 10, 0 );
remove_action('wp_head','rsd_link');
remove_action('wp_head','wlwmanifest_link');
remove_action('wp_head','wp_generator');

//Use customed jQuery Libary, From Google Fast CDN
if (!is_admin()) {
	wp_deregister_script('jquery');
}

//Register Menu
if (function_exists('register_nav_menus')){
	register_nav_menus( array(
'menubar' => '顶部菜单'
) );
}

//Register Sidebar
if ( function_exists('register_sidebar') )
{
	register_sidebar(array(
		'name' => '右边栏',
		'id' => 'right',
		'description' => '主内容右侧的边栏，建议设置文章列表、评论等',
		'before_widget' => '',
        'after_widget' => '',
        'before_title' => '<h3>',
        'after_title' => '</h3>',
	));
	register_sidebar(array(
		'name' => '文章下方',
		'id' => 'bottom',
		'description' => '单个文章下侧的边栏，默认放置相关文章、最新文章、随便看看等，建议您不要修改',
		'before_widget' => '',
        'after_widget' => '',
        'before_title' => '<span>',
        'after_title' => '</span>',
	));
}


function igoogler_comments($comment, $args, $depth) {
	$GLOBALS['comment'] = $comment;
	global $commentcount;
	if(!$commentcount) {
		$commentcount = 0;
	}
	?>

<li class="comment" id="comment-<?php comment_ID() ?>">
  <div class="brd">
    <div class="author">
      <?php if (function_exists('get_avatar') && get_option('show_avatars')) { echo get_avatar($comment, 48); } ?>
    </div>
    <div class="info">
      <div class="meta"> <span class="name">
        <?php if (get_comment_author_url()) : ?>
        <a class="url" target="_blank" href="<?php comment_author_url() ?>">
        <?php else : ?>
        <span>
        <?php endif; ?>
        <?php comment_author(); ?>
        <?php if(get_comment_author_url()) : ?>
        </a>
        <?php else : ?>
        </span>
        <?php endif; ?>
        </span>&nbsp;
        <?php comment_date('Y-m-j');?>
        &nbsp;
        <?php comment_reply_link( array_merge( $args, array( 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); edit_comment_link('编辑', ' | ', '');?>
      </div>
      <?php if ($comment->comment_approved == '0') : ?>
      <p><small>您的评论正在等待审核</small></p>
      <?php endif; ?>
      <div id="commentbody-<?php comment_ID() ?>">
        <?php comment_text(); ?>
      </div>
    </div>
    <div class="clear">&nbsp;</div>
  </div>
  <?php }?>
